package com.itr.kbm.model;

import java.util.ArrayList;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

@Entity
@Table (name = "LISTKOPTELPRODUCT")
@DynamicInsert
@DynamicUpdate
public class ListKoptelProduct extends BaseObject{

	/**
	 * 
	 */
	private static final long serialVersionUID = 7L;
	private int id;
	private String kodeKoptelProduct;
	private String namaKoptelProduct;
	private String password;
	
	public ListKoptelProduct(){}
	public ListKoptelProduct(int id, String kodeKoptelProduct, String namaKoptelProduct, String password) {
		this.id = id;
		this.kodeKoptelProduct = kodeKoptelProduct;
		this.namaKoptelProduct = namaKoptelProduct;
		this.password = password;
	}
	@Id
	@Column(name = "ID")
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	
	@Column(name = "KODEKOPTELPRODUCT")
	public String getKodeKoptelProduct() {
		return kodeKoptelProduct;
	}
	public void setKodeKoptelProduct(String kodeKoptelProduct) {
		this.kodeKoptelProduct = kodeKoptelProduct;
	}
		
	@Column(name = "NAMAKOPTELPRODUCT")
	public String getNamaKoptelProduct() {
		return namaKoptelProduct;
	}
	public void setNamaKoptelProduct(String namaKoptelProduct) {
		this.namaKoptelProduct = namaKoptelProduct;
	}
	
	@Column(name = "PASSWORD")
	public String getPassword() {
		return password;
	}
	public void setPassword(String password) {
		this.password = password;
	}
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + id;
		result = prime
				* result
				+ ((kodeKoptelProduct == null) ? 0 : kodeKoptelProduct
						.hashCode());
		result = prime
				* result
				+ ((namaKoptelProduct == null) ? 0 : namaKoptelProduct
						.hashCode());
		result = prime * result
				+ ((password == null) ? 0 : password.hashCode());
		return result;
	}
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		ListKoptelProduct other = (ListKoptelProduct) obj;
		if (id != other.id)
			return false;
		if (kodeKoptelProduct == null) {
			if (other.kodeKoptelProduct != null)
				return false;
		} else if (!kodeKoptelProduct.equals(other.kodeKoptelProduct))
			return false;
		if (namaKoptelProduct == null) {
			if (other.namaKoptelProduct != null)
				return false;
		} else if (!namaKoptelProduct.equals(other.namaKoptelProduct))
			return false;
		if (password == null) {
			if (other.password != null)
				return false;
		} else if (!password.equals(other.password))
			return false;
		return true;
	}
	@Override
	public String toString() {
		return "ListKoptelProduct [id="
				+ id
				+ ", "
				+ (kodeKoptelProduct != null ? "kodeKoptelProduct="
						+ kodeKoptelProduct + ", " : "")
				+ (namaKoptelProduct != null ? "namaKoptelProduct="
						+ namaKoptelProduct + ", " : "")
				+ (password != null ? "password=" + password : "") + "]";
	}
	
	
}
